﻿namespace Wolfpack.Contrib.Checks.EventLogParser
{
    // make it a singleton
    using System;
    using System.Collections.Generic;
    using System.Diagnostics;
    using System.IO;
    using Wolfpack.Core;
    using Wolfpack.Core.Interfaces;
    using Wolfpack.Core.Interfaces.Entities;

    /// <summary>
    /// Defines the settings to pull from the config file. 
    /// </summary>
    public class EventLogCheckConfig : PluginConfigBase
    {
        /// <summary>
        /// Gets or sets the name of the event log. Examples: System, Application.
        /// </summary>
        public String EventLogName { get; set; }

        /// <summary>
        /// Gets or sets the search string to find in the messages.
        /// If the eventlog message contains a message like the one below, it is likely that the dll to read localized strings is not
        /// registered in the registry [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\eventlog\*EventLogName*\*EventLogSource*]
        /// "EventMessageFile"=hex(2)
        /// EventLog Message Example: Source *EventSourceName*, Message The description for Event ID *EventIdNumber* in Source *EventSourceName* cannot be found.  
        /// The local computer may not have the necessary registry information or message DLL files to display the message, or you may not have permission to access them. 
        /// </summary>
        public String SearchExpression { get; set; }

        /// <summary>
        /// Gets or sets the EventLog Source.  Example: Server, PerNet, NetBios.
        /// </summary>
        public String Source { get; set; }

        /// <summary>
        /// Gets or sets the eventlog entry type.  Example: Error, Information.
        /// </summary>
        public String EntryType { get; set; }

        /// <summary>
        /// Gets or sets a number indicating the max number of log entries to read.
        /// Just in case the eventlog has run amok with entries we want to limit how many we will read into memory.
        /// </summary>
        public String MaxLogEntries { get; set; }

        /// <summary>
        /// Gets or sets a number indicating the max hours to look back into the event log.
        /// If Wolfpack has been shutdown for awhile, we don't want to pull a months worth of log entries into memory.
        /// </summary>
        public String MaxSecondsToRead { get; set; }

        /// <summary>
        /// Gets or sets a number indicating how many sucessive tests failed.
        /// </summary>
        public String NumberOfFailures { get; set; }

        /// <summary>
        /// Gets or sets a number indicating how many items in the event log match the criteria
        /// </summary>
        public String NumberOfMatches { get; set; }
    }
}
